﻿CREATE TABLE [dbo].[ItineraryService]
(
	[ItineraryServiceId] BIGINT NOT NULL  IDENTITY, 
    [ServiceUuid] NVARCHAR(50) NOT NULL, 
    [Name] NVARCHAR(100) NOT NULL, 
    [Type] NVARCHAR(50) NOT NULL, 
    [IsRequestResponse] BIT NOT NULL, 
    [Position] INT NOT NULL, 
    [Stage] NVARCHAR(50) NULL, 
    [Id] NVARCHAR(50) NOT NULL, 
    [NextId] NVARCHAR(50) NULL, 
    [BusinessName] NVARCHAR(250) NOT NULL, 
    [ModifiedOn] DATETIME NOT NULL, 
    [ModifiedBy] NVARCHAR(50) NOT NULL, 
    [ItineraryName] NVARCHAR(256) NOT NULL, 
    [ItineraryMajorVersion] BIGINT NOT NULL, 
    [ItineraryMinorVersion] BIGINT NOT NULL,
	CONSTRAINT [itineraryservice_pk] PRIMARY KEY CLUSTERED ([ItineraryServiceId] ASC), 
    CONSTRAINT [FK_ItineraryService_To_Itinerary] FOREIGN KEY ([ItineraryName], [ItineraryMajorVersion], [ItineraryMinorVersion]) REFERENCES [Itinerary]([strName], [nMajor], [nMinor])
)
